﻿/*********************************************************************************
**                                                                              **
**  Copyright (C) 2024 LiLong                                                   **
**  This file is part of IonexFileReader.                                       **
**                                                                              **
**  IonexFileReader is free software: you can redistribute it and/or modify     **
**  it under the terms of the GNU General Public License as published by        **
**  the Free Software Foundation, either version 3 of the License, or           **
**  (at your option) any later version.                                         **
**                                                                              **
**  IonexFileReader is distributed in the hope that it will be useful,          **
**  but WITHOUT ANY WARRANTY; without even the implied warranty of              **
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               **
**  GNU General Public License for more details.                                **
**                                                                              **
**  You should have received a copy of the GNU General Public License           **
**  along with IonexFileReader. If not, see <https://www.gnu.org/licenses/>.    **
**********************************************************************************/
#pragma once

#include "Datadefine.h"
#include "IonexFileReaderGlobal.h"

#include <memory>
#include <optional>
#include <string>

namespace Ionex
{
class IONEXFILEREADER_EXPORT IonexFile
{
public:
    explicit IonexFile(const std::string& source);
    explicit IonexFile(std::string&& source);
    ~IonexFile();
    bool load();
    double fileVersion() const;
    const std::string& fileType() const;
    SatelliteSystem satelliteSystem() const;
    const std::string& createByProgram() const;
    const std::string& createByAgency() const;
    const std::string& createDateTime() const;
    const std::vector<std::string>& descriptions() const;
    const std::vector<std::string>& comments() const;
    const DateTime& epochOfFirstMap() const;
    const DateTime& epochOfLastMap() const;
    int interval() const;
    int ofMapsInFile() const;
    MapingFunction mapingFunction() const;
    double elevationCutOff() const;
    double baseRadius() const;
    int mapDimension() const;
    std::tuple<double, double, double> hgt1Hgt2DHgt() const;
    std::tuple<double, double, double> lat1Lat2DLat() const;
    std::tuple<double, double, double> lon1Lon2DLon() const;
    const std::optional<int>& exponent() const;
    const std::vector<DataMap>& tecMaps() const;
    const std::vector<DataMap>& rmsMaps() const;
    const std::vector<DataMap>& heightMaps() const;

private:
    struct Impl;
    std::unique_ptr<Impl> m_impl;
};
} // namespace Ionex